Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: perform dimensional analysis and numerical evaluation in same pass #312

Merged
merged 54 commits into from
Jan 22, 2025

Conversation

mgreminger
Copy link
Owner

@mgreminger mgreminger commented Jan 3, 2025

This will enable cases where dimensional analysis depends on results of evaluation pass (variable matrix size output, for example).

Removes one recursive walk through the expression tree.
@mgreminger mgreminger changed the title refactor: perform dimensional analysis and computation in same pass (WIP) refactor: perform dimensional analysis and numerical evaluation in same pass (WIP) Jan 3, 2025
…holder function

Simplifies replace_placeholder_funcs function by removing a special case
Values needed for dimensional analysis are stored in the evaluation pass instead
Code generation still has issues
Use strings instead of BigInt for efficiency
Firefox is consistently timing out on this test
rational exponents with large denominators causes very long calculation times.
Prevents losing exactness for symbolic results while speeding up numerical results
Add test for symbolic representation of small rationals
This allows functions like range that need to know the result of the calculation to set the correct dims. Range now works with inputs that have consistent units. New test added for this functionality.
Removed remaining unitless sub query code
Rounding off can prevent addition from working
Check wasn't working for non-sympy dimension exponents
…ensure_dims_all_compatible"

This reverts commit 1e23b20.
Only impacted integrals with user functions in the integrand
Provides a significant speedup and eliminates any possibility of mismatch between passes for dim functions that need evaluation pass values
Needed since placeholder functions aren't used in this case and future versions of SymPy may change this behavior
@mgreminger mgreminger changed the title refactor: perform dimensional analysis and numerical evaluation in same pass (WIP) refactor: perform dimensional analysis and numerical evaluation in same pass Jan 21, 2025
@mgreminger mgreminger merged commit ba9ae56 into main Jan 22, 2025
1 check passed
@mgreminger mgreminger deleted the dimensional-analysis-refactor branch January 22, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant